package com.company;

public class Main {

    public static void main(String[] args) {
	    int a[] = {1,55,23,21,3};
	    int temp ;
	    int i,j;
	    for(i=1;i<a.length;i++)
        {
            if(a[i]<a[i-1])
            {
                temp = a[i];
                a[i] = a[i-1];
                for (j=i-2;j>=0&&a[j]>temp;j--)
                {
                        a[j+1]=a[j];
                }
                a[j+1] = temp;
            }
        }
        for (int c=0;c<a.length;c++)
        {
            System.out.println(a[c]);
        }
    }
}
